package com.zhuang.chapter23;

import java.util.ArrayList;

public class MontBaseTest {
	public static void main(String[] args) {
		MontBase montBase = new MontBase();
		MontBase dragon = new Dragon();
		MontBase pig = new Pig();
		ArrayList<MontBase> list = new ArrayList<MontBase>();
		list.add(montBase);
		list.add(dragon);
		list.add(pig);
		list.forEach(e -> {
			e.attach();
		});
	}
}
